package cn.sitemaker.app.bean;


import cn.sitemaker.app.R;
import cn.sitemaker.app.fragment.AboutOSCFragment;
import cn.sitemaker.app.fragment.DistinationFragment;
import cn.sitemaker.app.fragment.FeedBackFragment;
import cn.sitemaker.app.fragment.MyInformationFragment;
import cn.sitemaker.app.fragment.MyInformationFragmentDetail;
import cn.sitemaker.app.fragment.SettingsFragment;
import cn.sitemaker.app.fragment.SettingsNotificationFragment;
import cn.sitemaker.app.fragment.UserCenterFragment;

public enum SimpleBackPage {

    DISINATION(1, R.string.actionbar_title_distination, DistinationFragment.class),

    USER_CENTER(2, R.string.actionbar_title_user_center,UserCenterFragment.class),

    MY_INFORMATION(3, R.string.actionbar_title_my_information, MyInformationFragment.class),


    SETTING(4, R.string.actionbar_title_setting, SettingsFragment.class),

    SETTING_NOTIFICATION(5, R.string.actionbar_title_setting_notification, SettingsNotificationFragment.class),

    ABOUT_OSC(6, R.string.actionbar_title_about_osc, AboutOSCFragment.class),

    MY_INFORMATION_DETAIL(7, R.string.actionbar_title_my_information,  MyInformationFragmentDetail.class),

    FEED_BACK(8, R.string.str_feedback_title, FeedBackFragment.class);


    private int title;
    private Class<?> clz;
    private int value;

    private SimpleBackPage(int value, int title, Class<?> clz) {
        this.value = value;
        this.title = title;
        this.clz = clz;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public static SimpleBackPage getPageByValue(int val) {
        for (SimpleBackPage p : values()) {
            if (p.getValue() == val)
                return p;
        }
        return null;
    }
}
